open(BUFF,"MESA_Exome_Aug2012_byidno_20130329.fam") or die "no file found MESA_Exome_Aug2012_byidno_20130329.fam\n";
while(<BUFF>)
{
	chomp($_);
	@array=split(" ",$_);
	$hash{$array[1]}=$_;
}
close(BUFF);
open(BUFF,"../../mesa6814_protein_race.csv") or die " no file found mesa6814_protein_race.csv\n";
open(WRBUFF,">MESA_Exome_Aug2012_byidno_20130329_final.txt") or die "not able to write MESA_Exome_Aug2012_byidno_20130329_final.txt\n";
while(<BUFF>)
{
	chomp($_);
	@array=split(/\,/,$_);
	if(exists($hash{$array[0]}))
	{
		print WRBUFF $hash{$array[0]}."\n";
	}	
}
close(BUFF);
close(WRBUFF);
